<template>
	<u-navbar :is-back="false" :border-bottom="false" title="" :background="background">
		<slot>
			<view class="warpper">
				<view class="left" @click="returnFun">
					<view class="icon"></view>
					<view>返回</view>
				</view>
				<view class="content">
					{{title}}
				</view>
			</view>
		</slot>
	</u-navbar>
</template>

<script>
	export default{
		name:'topNav',
		props:{
			title:'',
			background:{
				type: Object,
				default:()=>({
					backgroundColor:'#202020',
					borderColor:'#202020',
				})
			}
		},
		methods:{
			returnFun(){
				uni.navigateBack();
			}
		}
	}
</script>

<style lang="scss" scoped>
	.warpper{
		width: 100%;
		height:100%;
		display: flex;
		align-items: center;
		background-color: #202020;
		position: relative;
		.left{
			position: absolute;
			left: 0;
			display: flex;
			height: 100%;
			align-items: center;
			.icon{
				width: 0;
				height: 0;
				border-top: 10rpx solid transparent;
				border-right: 12rpx solid #FFFFFF;
				border-bottom:10rpx solid transparent;
				margin:0 20rpx;
			}
		}
		.content{
			flex:1;
			text-align: center;
			font-size: 48rpx;
		}
	}
</style>
